import os, sys, time

parent_path = os.path.abspath(os.path.join(__file__, *([".."] * 3)))
sys.path.insert(0, parent_path)

from core.utils.logger import logging
from core.task.task_pipeline import TaskPipeline

if __name__ == "__main__":
    # 日志初始化
    log_path = os.path.join(os.path.dirname(__file__), "configs/log_cfg.yaml")
    logging.set_config(log_path)

    import time

    # task_pipeline_cfg_path = os.path.join(
    #     os.path.dirname(__file__), "configs/task_pipeline_cfg_local.yaml"
    # )
    task_pipeline_cfg_path = os.path.join(
        os.path.dirname(__file__), "configs/task_pipeline_cfg_video.yaml"
    )
    task_pipeline = TaskPipeline(task_pipeline_cfg_path)
    data = {
        "tag": "GangHang",
        "id": "1",
    }
    data["data"] = {"id": data["id"],"Left_Heading": False}

    task_pipeline.task_add(data=data)

    logging.info("|task start|")
    while True:
        time.sleep(1)
    logging.info("|INFO:done|")
